function * fn() {
    // 仅执行一次
    console.log('hello')
}

var g = fn()


console.log(g.next())
console.log(g.next())